﻿<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8" />
    <title>数据管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
    <meta content="Premium Multipurpose Admin & Dashboard Template" name="description" />
    <meta content="MyraStudio" name="author" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />

    <!-- App favicon -->
    <link rel="shortcut icon" href="/assets/images/favicon.ico">



    <!-- App css -->
    <link href="/assets/css/bootstrap.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/icons.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/theme.min.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/bootstrap-table.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/bootstrap-editable.css" rel="stylesheet" type="text/css" />
    <link href="/assets/layui/css/layui.css" rel="stylesheet" type="text/css" />
    <link href="/assets/css/step.css" rel="stylesheet" type="text/css" />
    <style>
        .login-user {
            display: flex;
            color: #000;
            line-height: 30px;
        }

        .login-user input {
            height: 30px;
            border-radius: 4px;
            margin: 0px 4px;
        }

        .login-user select {
            height: 30px;
            border-radius: 4px;
            margin: 0px 4px;
            width: 20px;
        }
    </style>
</head>

<body>

    <!-- Begin page -->
    <div id="layout-wrapper">


        <div class="container-fluid" style="margin-top: 10px;">

            <!-- start page title -->

            <div class="row">
                <div class="col-12">
                    <div class="card">
                        <div class="card-body">

                            <h4 class="card-title">协议字段配置</h4>
                            <button type="button" class="btn btn-primary waves-effect waves-light"
                                onclick="createProtofieldModel()">新增</button>
                            <br></br>

                            <table id="table_page" class="table mb-0">

                            </table>

                        </div> <!-- end card body-->
                    </div> <!-- end card -->
                </div><!-- end col-->
            </div>
            <!-- end row-->



        </div> <!-- container-fluid -->

    </div>
    <!-- END layout-wrapper -->




    <!-- Add model -->
    <div id="protofieldModal" class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog"
        aria-labelledby="protofieldModalLabel" style="display: none;">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <!--模态框的头部内容-->
                <div class="modal-header">

                    <h4 class="modal-title" id="protofieldModalLabel">新增协议字段</h4>
                </div>
                <!--模态框的主体内容-->

                <div class="layui-fluid">
                    <div class="layui-card">
                        <div class="layui-card-body" style="padding-top: 40px;">
                            <div class="layui-carousel" id="stepForm" lay-filter="stepForm" style="margin: 0 auto;">
                                <div carousel-item class="layui-form" lay-filter="protofield">
                                    <div>
                                        <form class="layui-form"
                                            style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
                                            <div class="layui-form-item">
                                                <label class="layui-form-label">名称:</label>
                                                <div class="layui-input-block">
                                                    <input type="text" name="name" placeholder="请填写名称"
                                                        class="layui-input" lay-verify="required" required />
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label"
                                                    style="white-space: nowrap;">解决方式:</label>
                                                <div class="layui-input-block">
                                                    <select name="method" class="layui-input" lay-verify="required"
                                                        lay-filter="method" type="text">
                                                        <option value="null">请选择</option>
                                                        <option value="dict_name">字典</option>
                                                        <option value="logical_expressions">逻辑表达式</option>
                                                        <option value="parse_list_name">解析表</option>
                                                        <option value="ascii">字符串(无需输入或选择，默认ascii)</option>
                                                        <option value="hex">原始值(无需输入或选择，默认hex)</option>
                                                        <option value="strtrim">分隔符</option>
                                                        <option value="bits">位处理</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-form-item" id="selectType" style="display: none;">
                                                <label class="layui-form-label">方法:</label>
                                                <div class="layui-input-block">
                                                    <select name="methodvalueS" id="methodvalueS" class="layui-input"
                                                        lay-verify="required" lay-filter="methodvalueS" type="text">
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-form-item" id="inputType" style="display: none;">
                                                <label class="layui-form-label">方法:</label>
                                                <div class="layui-input-block">
                                                    <input name="methodvalue" id="methodvalue" lay-filter="methodvalue"
                                                        type="text" placeholder="示例：逻辑表达式($var*1+1)/2，分隔符:','，';'" class="layui-input"
                                                        required />
                                                </div>
                                            </div>
                                            <div class="layui-form-item" id="value_type" style="display: none;">
                                                <label class="layui-form-label">值类型:</label>
                                                <div class="layui-input-block">
                                                    <select name="value_type" class="layui-input" type="text"
                                                        lay-filter="value_type">
                                                        <option value="char">char</option>
                                                        <option value="short">short</option>
                                                        <option value="int">int</option>
                                                        <option value="double">double</option>
                                                        <option value="float">float</option>
                                                        <option value="long">long</option>
                                                        <option value="unsigned char">unsigned char</option>
                                                        <option value="unsigned short">unsigned short</option>
                                                        <option value="unsigned int">unsigned int</option>
                                                        <option value="unsigned long">unsigned long</option>
                                                    </select>
                                                </div>
                                            </div>
                                            <div class="layui-form-item" id="value_length" style="display: none;">
                                                <label class="layui-form-label">值长度:</label>
                                                <div class="layui-input-block">
                                                    <input type="text" id="length" name="length"
                                                        placeholder="请填写长度（char型默认1，其余类型无需填写）" class="layui-input"
                                                        lay-filter="length" />
                                                </div>
                                            </div>
                                            <div class="layui-form-item" id="value_unit" style="display: none;">
                                                <label class="layui-form-label">单位:</label>
                                                <div class="layui-input-block">
                                                    <input type="text" id="unit" name="unit" placeholder="若无单位无需填写"
                                                        class="layui-input" lay-filter="unit" />
                                                </div>
                                            </div>
                                            <div class="layui-form-item" id="value_bits" style="display: none;">
                                                <label class="layui-form-label"  style="white-space: nowrap;">比特位配置:</label>
                                                <div class="layui-input-block">
                                                    <button type="button" class="layui-btn"
                                                        onclick="editBitsModel()">编辑</button>
                                                </div>
                                            </div>
                                            <div class="layui-form-item">
                                                <label class="layui-form-label" style="white-space: nowrap;">数据库表<br>字段名称:</label>
                                                <div class="layui-input-block">
                                                    <input type="text" name="dbfield" placeholder="请填写名称"
                                                        class="layui-input" lay-verify="required" required />
                                                </div>
                                            </div>


                                            <div class="layui-form-item">
                                                <div class="layui-input-block">
                                                    <button class="layui-btn" lay-submit lay-filter="formStep"
                                                        id="confirm">
                                                        &emsp;下一步&emsp;
                                                    </button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>


                                    <div>
                                        <form class="layui-form"
                                            style="margin: 0 auto;max-width: 460px;padding-top: 40px;">
                                            <fieldset class="layui-elem-field">
                                                <legend>内容总览</legend>
                                                <div class="layui-field-box">
                                                    <div class="layui-form-item" id="textA"></div>
                                                    <div class="layui-form-item" id="textB"></div>
                                                    <div class="layui-form-item" id="textC"></div>
                                                    <div class="layui-form-item" id="textD"></div>
                                                    <div class="layui-form-item" id="textE"></div>
                                                    <div class="layui-form-item" id="textF"></div>
                                                    <div class="layui-form-item" id="textG"></div>
                                                </div>
                                            </fieldset>
                                            <div class="layui-form-item">
                                                <div class="layui-input-block">
                                                    <button type="button"
                                                        class="layui-btn layui-btn-primary pre">上一步</button>
                                                    <button class="layui-btn" lay-submit lay-filter="formStep2">
                                                        &emsp;确认&emsp;
                                                    </button>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                    <div>
                                        <div style="text-align: center;margin-top: 40px;">
                                            <i class="layui-icon layui-circle"
                                                style="color: white;font-size:30px;font-weight:bold;background: #52C41A;padding: 20px;line-height: 80px;">&#xe605;</i>
                                            <div style="font-size: 24px;color: #333;font-weight: 500;margin-top: 30px;">
                                                填写完成
                                            </div>
                                            <div style="text-align: center;margin-top: 50px;">
                                                <button class="layui-btn next">返回</button>
                                                <button class="layui-btn layui-btn-primary"
                                                    id="testSubmitBtn">录入</button>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <!--模态框的尾部内容-->

                </div><!-- /.modal-content -->
            </div><!-- /.modal-dialog -->
        </div>
    </div>

    <!-- END model -->

    <!-- BITS model -->
    <div id="bitsModal" class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog" 
        aria-labelledby="bitsModalLabel" style="display: none;">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <!--模态框的头部内容-->
                <div class="modal-header">
                    <h4 class="modal-title" id="bitsModalLabel">比特位配置</h4>
                </div>
                <!--模态框的主体内容-->
                <button type="button" class="layui-btn" onclick="addBit('bitsTable')">新增</button>
                <form id="form-add" class="form-horizontal">
                    <table id="bitsTable"></table>
                </form>
                <button type="button" class="layui-btn" onclick="hideBitsModel()">关闭</button>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
    <!-- END model -->


    <!-- BITS EDIT model -->
    <div id="bitsEditModal" class="modal fade bd-example-modal-lg" tabindex="-1" role="dialog"
        aria-labelledby="bitsEditModalLabel" style="display: none;">
        <div class="modal-dialog modal-lg" role="document">
            <div class="modal-content">
                <!--模态框的头部内容-->
                <div class="modal-header">
                    <h4 class="modal-title" id="bitsEditModalLabel">比特位修改</h4>
                </div>
                <!--模态框的主体内容-->
                <button type="button" class="layui-btn" onclick="addBit('bitsEditTable')">新增</button>
                <form id="form-edit" class="form-horizontal">
                    <table id="bitsEditTable"></table>
                </form>
                <button type="button" class="layui-btn" onclick="saveEditBit()">保存</button>
            </div><!-- /.modal-content -->
        </div><!-- /.modal-dialog -->
    </div>
    <!-- END model -->

    <!-- model -->
    <!-- Overlay-->
    <div class="menu-overlay"></div>

    <script>
        var ipm = '[[${manageIp}]]';
    </script>
    <!-- jQuery  -->
    <script src="/assets/js/jquery.min.js"></script>
    <script src="/assets/js/bootstrap.bundle.min.js"></script>
    <script src="/assets/js/metismenu.min.js"></script>
    <script src="/assets/js/waves.js"></script>
    <script src="/assets/js/bootstrap-table.js"></script>
    <script src="/assets/js/bootstrap-table-zh-CN.js"></script>
    <script src="/assets/js/bootstrap-editable.js"></script>
    <script src="/assets/js/bootstrap-table-editable.js"></script>
    <script src="/assets/layui/layui.js"></script>
    <script src="/assets/js/step.js"></script>
    <!-- third party js -->

    <!-- third party js ends -->

    <!-- Datatables init -->
    <script src="/assets/pages/proto-field-demo.js"></script>
    <script src="/assets/pages/arrowall.js"></script>

    <!-- App js -->
    <script src="/assets/js/theme.js"></script>
</body>

</html>